#ifndef __LANDLOAD_H__
#define __LANDLOAD_H__

#include "game.h"
#include "../utils/list.h"
#include "../utils/uthash.h"

typedef struct {
    game_t *game;
    pthread_t thread;
    struct list_head list;
} game_node_t;

typedef struct {
    int id;
    game_node_t* node;
    UT_hash_handle hh;
} game_map;


typedef struct {
    int game_count;
    game_node_t game_list;
    game_map *map;
}Landload_t;

extern Landload_t *landload;

void landload_init();
void landload_add_game(game_node_t *game);
void landload_remove_game(game_node_t *game);
void landload_destory();
game_t *landload_get_game(int game_id);

game_node_t *landload_get_game_node(int game_id);

#endif // __LANDLOAD_H__